import request from "@/utils/request";

const BASE_URL = "/vehicle-verification-codes";

const CarCodeAPI = {
  getPage(params?: any) {
    return request<any, any>({
      url: `${BASE_URL}`,
      params,
      method: "get",
    });
  },

  // 根据日期获取验车码
  getDateCode(date: string) {
    return request<any, any>({
      url: `${BASE_URL}/date/${date}`,
      method: "get",
    });
  },

  /**
   * 获取当前登录用户信息
   *
   * @returns 登录用户昵称、头像信息，包括角色和权限
   */
  getInfo() {
    return request<any, any>({
      // url: `${BASE_URL}/me`,
      url: `${BASE_URL}/info`,
      method: "get",
    });
  },

  /**
   * 批量删除用户，多个以英文逗号(,)分割
   *
   * @param ids 用户ID字符串，多个以英文逗号(,)分割
   */
  deleteByIds(ids: string) {
    return request({
      url: `${BASE_URL}/${ids}`,
      method: "delete",
    });
  },

  /**
   *  获取用户下拉列表
   */
  getOptions() {
    return request<any, OptionType[]>({
      url: `${BASE_URL}/options`,
      method: "get",
    });
  },
};

export default CarCodeAPI;
